Make trees in R

# 1. distance
d <- dist(t(data))

# 2. plot
# 2.1 hclust
tree <- hclust(d)
plot(tree)

# 2.2 nj and upgma trees
library(phangorn)
# nj tree
tree <- nj(d)
plot(tree,main="nj tree")
plot(tree,'u',main='nj tree')
# upgma tree
tree = upgma(d)
plot(tree,main="upgma tree")
Homepage
Comments

Hide Comments